<template>
  <el-card
    shadow="never"
    header="八、项目研究人员组织"
    :body-style="{ color: '#606266', lineHeight: 1.5 }"
  >
    <vxe-table
      border
      show-overflow
      :data="mainMembers"
      :column-config="{ resizable: true }"
    >
      <vxe-column field="type" title="类型">
        <template #default="{ row }">{{ getType(row.type) }}</template>
      </vxe-column>
      <vxe-column field="name" title="姓名" />
      <vxe-column field="unitDepartment" title="单位/部门" />
      <vxe-column field="age" title="年龄" />
      <vxe-column field="titlePosition" title="职称/职务" />
      <vxe-column field="specialty" title="从事专业" />
      <vxe-column field="phone" title="联系电话" />
    </vxe-table>
  </el-card>
</template>

<script setup>
  defineProps({
    mainMembers: {
      type: Array,
      default: () => [],
    },
  })

  const typeMap = {
    1: '课题负责人',
    2: '项目主要研究成员',
  }

  const getType = (type) => typeMap[type]
</script>

<style lang="scss" scoped></style>
